import Vue from "vue";
import Vuex from "vuex";
import vuexPersistedstate from "vuex-persistedstate";
import user from "./modules/user";

Vue.use(Vuex);

const storagePlugin = vuexPersistedstate({
  storage: window.localStorage,
  paths: ["user.authUser"],
});

export default new Vuex.Store({
  plugins: [storagePlugin],
  modules: {
    user,
  },
});
